/* eslint-disable*/

export function bindTest() {
    let tmp1 = {};
    let tmp2 = {};
    let tmp3 = {};
    sum.apply(tmp1,[1,2,3,4]);
    console.log(tmp1.result);
    sum.call(tmp2,1,2,3,4);
    console.log(tmp2.result);
    var newSum = sum.bind(tmp3,1,2,3,4);
    newSum();
    console.log(tmp3.result)
}



function sum() {
    let result = 0;
    for(let n = 0; n < arguments.length ; n++){
        result += arguments[n];
    }
    this.result = result;
}
